import request from '@/utils/request'

// 查询餐饮列表
export function listRestaurant(query) {
  return request({
    url: '/logex/restaurant/list',
    method: 'get',
    params: query
  })
}

// 查询餐饮信息详细
export function getRestaurant(id) {
  return request({
    url: '/logex/restaurant/' + id,
    method: 'get'
  })
}

// 新增餐饮
export function addRestaurant(data) {
  return request({
    url: '/logex/restaurant',
    method: 'post',
    data: data
  })
}

// 修改餐饮
export function updateRestaurant(data) {
  return request({
    url: '/logex/restaurant',
    method: 'put',
    data: data
  })
}

// 删除餐饮
export function delRestaurant(id) {
  return request({
    url: '/logex/restaurant/' + id,
    method: 'delete'
  })
}

export function changeStatus(data) {
  return request({
    url: '/logex/restaurant/changeStatus',
    method: 'put',
    data: data
  })
}


// 查询食品列表
export function listFood(query) {
  query.pageNum = 1
  query.pageSize = 999
  return request({
    url: '/logex/restaurantFood/list',
    method: 'get',
    params: query
  })
}

// 查询食品详细
export function getFood(id) {
  return request({
    url: '/logex/restaurantFood/' + id,
    method: 'get'
  })
}

// 新增食品
export function addFood(data) {
  return request({
    url: '/logex/restaurantFood',
    method: 'post',
    data: data
  })
}

// 修改食品
export function updateFood(data) {
  return request({
    url: '/logex/restaurantFood',
    method: 'put',
    data: data
  })
}

export function changeStatusFood(data) {
  return request({
    url: '/logex/restaurantFood/changeStatus',
    method: 'put',
    data: data
  })
}

// 删除食品
export function delFood(id) {
  return request({
    url: '/logex/restaurantFood/' + id,
    method: 'delete'
  })
}
